<?php
namespace app\admin\library\rules;
use app\common\model\Account;
use think\Db;
use think\Session;

class Rules
{
    /**
     * 判断是否有权限
     * @param rules_id 查询全部订单=2,显示报单价=4,无团队数据=6
     * 
     */
    public static function hasRules($rules_id){
        // 获取权限
        $id = Session::get('uid');
        $rules = Account::where('id',$id)->value('rules');
        $rules_arr = explode(',',$rules);
        $res = in_array($rules_id,$rules_arr);
        return $res;
    }
}